<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<script type="text/javascript" src="../public/lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="../public/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="../public/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="../public/ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="../public/ueditor/ueditor.patch-setCrossDomain.js"> </script>
<#include "lib/lib.html" />
<title>文章修改</title>
</head>
<body>
<div class="pd-20">
	<form action="${basePath}/news/updateProject.do" method="post"  class="form form-horizontal" id="form-area-add" enctype="multipart/form-data">
		<input type="hidden" name="id" value="${info.id!}"/>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>文章标题：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="${info.newsTitle!}" placeholder="" id="newsTitle" name="newsTitle" >
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">文章类型：</label>
			<div class="formControls col-5">
				<div class="radio-box">
					<input name="newsType" type="radio" value="1" <#if info.newsType==1>checked</#if>>
					<label for="sex-1">帮助中心</label>
				</div>
				<div class="radio-box">
					<input type="radio" value="2" name="newsType" <#if info.newsType==2>checked</#if>>
					<label for="sex-2">关于我们</label>
				</div>
				<div class="radio-box">
					<input type="radio" value="3" name="newsType" <#if info.newsType==3>checked</#if>>
					<label for="sex-2">其他</label>
				</div>
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">图片：</label>
			<div class="formControls col-5">
				  <span class="btn-upload">
				  <a href="javascript:void();" class="btn btn-primary radius"><i class="iconfont">&#xf0020;</i> 浏览文件</a>
				 <input type="file" multiple name="file" class="input-file" accept="image/png,image/jpg,image/jpeg,imge/bmp,image/gif">
				 </span>
				 <img alt="" src="${info.newsImgs!}" width="160" height="160">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">摘要：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="${info.newsSummary!}"  id="newsSummary" name="newsSummary">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">关键词：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="${info.newsKeyWord!}" id="newsKeyWord" name="newsKeyWord">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">正文：</label>
			<div class="formControls col-5" style="width: 700px">
				<label class="form-label col-xs-4 col-sm-3">正文：</label>
			<script id="container" name="newsContent" type="text/plain" >${info.newsContent!}</script>
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<div class="col-9 col-offset-3">
				<button type="button" onclick="submitBtn()" class="btn btn-success radius" id="admin-role-save" name="admin-role-save">
						<i class="icon-ok"></i> 确定
				</button>
				<button type="button" onclick="layer_close()" class="btn btn-success radius" id="admin-role-close"
						name="admin-role-close">
						<i class="icon-ok"></i>取消
					</button>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript">
var ue = UE.getEditor('container',{
	toolbars:[
	[ 'source', 'undo', 'redo', 'bold','indent','italic','underline',
	'strikethrough','subscript','fontborder','superscript','formatmatch','horizontal','removeformat','fontfamily',
	 'fontsize','paragraph','link','justifyleft','justifyright','justifycenter','justifyjustify','forecolor','backcolor',
	 'insertorderedlist','insertunorderedlist','directionalityltr','directionalityrtl','rowspacingtop','rowspacingbottom',
	 'imagecenter','lineheight']
	]
});
function submitBtn(){
	var newsTitle = $("#newsTitle").val();
	if(newsTitle == ""){
		layer.msg('标题不能为空', {
			icon : 1,
			time : 1000
		});
		return ;
	}
	
	$("#form-area-add").ajaxForm({
		success:function(data) {
			if(data == 200){
				layer.msg('添加成功!', {icon: 6,time:1000});
				window.parent.location.href="${basePath}/news/list.do";
			}else{
				layer.msg(data.data, {icon: 5,time:1000});
			}
		},      
		dataType:"json"   
	}).submit(); 	
}
</script>
</body>
</html>